home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_inf_door.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  143 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_DoorCam.cog
  4. #
  5. # This is the generic door with a camera attached
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     message     startup
  14.     message     activate
  15.     message     blocked      
  16.                 
  17.     thing        switch0         linkid=1              //switch on one side of the door
  18.     thing        switch1         linkid=1              //switch on the other side of the door (optional)
  19.     thing       door0
  20.     thing       player          local
  21.    
  22.     sector      doorsector
  23.    
  24.     flex        doorspeed=1.0
  25.     flex        switchspeed=2.0
  26.     flex        waittime=5.0
  27.                  
  28.     int            flag=0          local
  29.     int         blockcheck=0    local
  30.     int         actcheck=0      local
  31.     int         firstime=0      local
  32.     int         wepnum=1        local
  33.     int         lastrand=-1     local
  34.     int         currand=0       local
  35.     
  36.     sound       indylineb0=inxj058.wav      local
  37.     sound       indylineb1=inxj059.wav      local
  38.     sound       indylineb2=inxj060.wav      local
  39.     sound       indylineb3=inxj061.wav      local
  40.     sound       indylineb4=inxj090.wav      local
  41.     sound       indylineb5=inxj095.wav      local
  42.     
  43. end
  44.  
  45. # ========================================================================================
  46.  
  47. code
  48.  
  49. startup:
  50.     player = GetLocalPlayerThing();
  51.     SectorAdjoins(doorsector, 0);
  52.     return;
  53.  
  54. #........................................................................................
  55. activate:
  56.     if ((GetSenderID() == 1) && (actcheck == 0) && (GetCurItem(player) == 0))
  57.     {
  58.         actcheck = 1;
  59.         While(wepnum !=0)
  60.         {
  61.             wepnum = GetCurWeapon(player);
  62.             DeselectWeaponWait(player);
  63.             DeselectWeapon(player);
  64.             //printint(wepnum);
  65.         }
  66.         StopThing(player);
  67.         SetActorFlags(player, 0x200000);
  68.         StartCutscene(1);
  69.         PlayMode(player, 60, 0);
  70.         Sleep(0.35);
  71.         if (switch0 != -1) 
  72.         {
  73.             MoveToFrame(switch0, 1, switchspeed);
  74.         }
  75.         if (switch1 != -1)
  76.         {
  77.             MoveToFrame(switch1, 1, switchspeed);
  78.         }
  79.         WaitForStop(switch0);
  80.         Sleep(1);
  81.         ClearActorFlags(player, 0x200000);
  82.         EndCutscene();
  83.         SectorAdjoins(doorsector, 1);
  84.         MoveToFrame(door0, 1, doorspeed);
  85.         WaitForStop(door0);
  86.         Sleep(10);
  87.         if (switch0 != -1) 
  88.         {
  89.             MoveToFrame(switch0, 0, switchspeed);
  90.         }
  91.         if (switch1 != -1)
  92.         {
  93.             MoveToFrame(switch1, 0, switchspeed);
  94.         }
  95.         MoveToFrame(door0, 0, doorspeed);
  96.         WaitForStop(door0);
  97.         actcheck = 0;
  98.         wepnum = 1;
  99.         return;
  100.     }
  101.     
  102.     if ((GetCurItem(player) != 0) && (GetSenderID() == 1))
  103.     {
  104.         StopThing(player);
  105.         StartCutscene(0);
  106.         SetActorFlags(player, 0x200000);
  107.         currand = RandBetween(0, 5);
  108.         While (lastrand == currand)
  109.         {
  110.             currand = RandBetween(0, 5);
  111.         }
  112.         PlayVoice(player, indylineb0[currand], 1, 1);
  113.         lastrand = currand;
  114.         EndCutscene();
  115.         ClearActorFlags(player, 0x200000);
  116.     }
  117.     
  118.     return;
  119.     
  120. #........................................................................................
  121. blocked:
  122.     if (GetSenderRef() == door0);
  123.     {
  124.         if (switch0 != -1) 
  125.         {
  126.             MoveToFrame(switch0, 1, switchspeed);
  127.         }
  128.         if (switch1 != -1)
  129.         {
  130.             MoveToFrame(switch1, 1, switchspeed);
  131.         }
  132.         MoveToFrame(door0, 1, doorspeed);
  133.         WaitForStop(door0);
  134.         SetTimer(10);
  135.         
  136.     }
  137.     return;
  138.         
  139.  
  140. end
  141.  
  142.  
  143.